package com.hmall.client;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author liCuiPing
 * @since 2022/12/9 14:39
 */
@Component
@FeignClient("itemservice")
public interface ItemClient {
     @GetMapping("item/list")
     PageDTO<Item> findPage(@RequestParam("page") Integer pageNumber, @RequestParam("size") Integer pageSize) ;

     @GetMapping("item/{id}")
     Item findById(@PathVariable Long id) ;

     @PutMapping("item/stock/{itemId}/{num}")
     void updateStock(@PathVariable("itemId") Long itemId, @PathVariable("num") Integer num);

}